<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>通讯组管理</title>


<script type="text/javascript" src="message/js/javascript.js"></script>
  <link rel="stylesheet" href="css/vote_css.css" type="text/css"></link>
<link rel="stylesheet" href="message/css/message_css.css" type="text/css"></link>
<script type="text/javascript">

	String.prototype.trim=function(){
  			return this.replace(/(^\s*)|(\s*$)/g,"");
  		}

	function validates(){
		var addName = document.getElementById("addName").value.trim();
		if(addName==""){
			document.getElementById("addNameId").style.display="block";
  			document.getElementById("addNameId").innerHTML="<span style='color:red'>查询条件不能为空或不能输入空格</span>";
			return false;
		}else{
			return true;
		}
	}
  	function validate(){
  		if(confirm("删除该组将删除该组中的所有联系人，是否继续？")){
  			return true;
  		}6
  		return false;  			
  	}
  	function submits(){
  		var number=document.getElementById("pageSize").value;
  		if(number<=0){
  			document.getElementById("pageSize").value=5;
  			alert("当前显示页数只能为正整数");  			
  		}
  		document.forms.submit();
  	}
  	function noneDiv(id){
  		document.getElementById(id).style.display="none";
  	}
  </script>

</head>

<body> 
		<div class="top">
    			&nbsp;<img src="images/index_32.gif"></img>&nbsp;添加联系人
    	</div>
    	<br />
<form name="forms" id="forms" action="listAddress" method="post">
	<div id="message">
		<div id="message_main">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" class="td_01">通讯组查询</td>
    </tr>
  <tr>
    <td class="td_01">通讯组名称：</td>
    <td class="td_01">
      <input name="addName" id="addName" type="text" size="65" onblur="validates()" onfocus="noneDiv('addNameId')" />
      <input type="submit" name="Submit" value="查询" onclick="return validates()" class="buttonface02" />
      	<div id="addNameId"></div>
      </td>
  </tr>
  <tr>
    <td colspan="2" class="td_01" align="right">
			<input name="" type="button" value="新增通讯组" onclick="location.href='message/add.jsp'" class="buttonface02"/>
			&nbsp;&nbsp;&nbsp;
		</td>
    </tr>
  <tr>
  	<td align="left" class="td_01" height="28">  			
		  <br/>&nbsp;本页共显示<input type="text" name="pageSize" id="pageSize" size="1" value="${pageBean.pageSize}"/>&nbsp;<a href="javascript:submits()">GO>></a>条数据
  	</td>
    <td align="right" class="td_01" height="28">
    <br/>
    
			<img src="message/images/1.gif"></img>
   			<a href="listAddress?pageIndex=1">首页</a>&nbsp;
   			<img src="message/images/2.gif"></img>
			<c:if test="${pageBean.currentPage<=1}">上一页</c:if>
			<c:if test="${pageBean.currentPage>1}"><a href="listAddress?pageIndex=${pageBean.currentPage-1 }">上一页</a></c:if>&nbsp;					    	
			<c:if test="${pageBean.currentPage>=pageBean.totalRecords}">下一页</c:if>
			<c:if test="${pageBean.currentPage<pageBean.totalRecords}"><a href="listAddress?pageIndex=${pageBean.currentPage+1 }">下一页</a></c:if>&nbsp;
			<img src="message/images/2-2.gif"></img>
			第${pageBean.currentPage}页&nbsp;					    	
			<a href="listAddress?pageIndex=${pageBean.totalRecords }">末页</a>
			&nbsp;<img src="message/images/3.gif"></img>
			共${pageBean.totalRecords }页&nbsp;
    </td>
    </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>		
		<td class="td_top">&nbsp;通讯组名称</td>
		<td class="td_top">通讯组描述</td>
		<td class="td_top">查看成员</td>
		<td class="td_top">修改通讯组</td>	
		<td class="td_top">删除通讯组</td>	
	</tr>
	<s:iterator value="list">
	<tr id="message_tr">
		<td height="20" width="20%" class="td_01"><s:property value="addressGroupName"/></td>
		<td class="td_01"><s:property value="addressGroupDesc"/></td>
		<td class="td_01"><a href="find?id=<s:property value='addressGroupId'/>">查看成员</a></td>
		<td class="td_01"><a href="groupById?id=<s:property value='addressGroupId'/>">修改通讯组</a></td>
		<td class="td_01"><span onclick="return validate()"><a href="deleteGroup?id=<s:property value='addressGroupId'/>">删除通讯组</a></span></td>
	</tr>	
	</s:iterator>
	
</table>	
		</div>
	</div>
	</form>
</body>
</html>
